package com.platform.util;

public class NumberUtil {
    public static int safeToNumber(Object o){
        Integer r = 0;
        if (o != null) {
            try {
                r = new Integer(String.valueOf(o));
            } catch (Exception var4) {
            }
        }

        return r;
    }

    public static int safeToNumber(Object o,Integer defaultNum){
        Integer r = 0;
        if (o != null) {
            try {
                r = new Integer(String.valueOf(o));
            } catch (Exception var4) {
            }
        }
        if(r  == 0){
            return defaultNum;
        }
        return r;
    }
}
